﻿using _16_EFCore;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace _16_EFCore_API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class maoyanController : ControllerBase
    {
        private readonly MyDbContext myDbContext;
        public maoyanController(MyDbContext myDbContext)
        {
            this.myDbContext = myDbContext;
        }
        [HttpGet]
        public string Get()
        {
            var count = myDbContext.MaoYans.Count();
            return $"总共{count}条数据";
        }
    }
}
